package com;

import org.apache.ibatis.session.SqlSession;

public class App {
    public static void main(String[] args) {

        MyBatisSqlSessionFactory factory = new MyBatisSqlSessionFactory();
        SqlSession sqlSession = factory.getMyBatisSqlSessionFactory().openSession();

        TestDao testDao = sqlSession.getMapper(TestDao.class);
        // sqlSession.delete("com.TestDao.getDeleteCar",2);

        System.out.println(testDao);

        //插入
        Car car = new Car();
        car.setName("领克");
        car.setPrivce(20000.0f);
        int id = testDao.getInsertCar(car);
        sqlSession.commit();
        System.out.println(id);
        System.out.println(car.getId());
    }
}
